
import _request from "../common/_request";

let lib_car = {
    // 品牌
    brand: function (activity_id,custom_car) {
        let data = {};
        data.activity_id = activity_id;
        data.custom_car = custom_car;
        // console.log(data, '===');
        return _request._get('/car/brand', data)
    },
    // 车型
    series: function (activity_id,custom_car,brand_id) {
        let data = {};
        data.activity_id = activity_id;
        data.custom_car = custom_car;
        data.brand_id = brand_id;
        return _request._get('/car/series', data)
    },

    // 之家
    // 品牌
    brandx: function ( callback) {
        let data = {};
        _request._get('/car/brandx', data, function (response) {
            if (response.code !== _request.success) {
                Message.info(response.msg);
                return;
            }
            //回调数据
            if (typeof callback === 'function') {
                callback(response.data)
            }
        })
    },
    // 车型
    seriesx: function (brand_id, callback) {
        let data = {};
        data.brand_id = brand_id;
        _request._get('/car/seriesx', data, function (response) {
            if (response.code !== _request.success) {
                Message.info(response.msg);
                return;
            }
            //回调数据
            if (typeof callback === 'function') {
                callback(response.data)
            }
        })
    },

    // 车款
    productx: function (series_id, callback) {
        let data = {};
        data.series_id = series_id;
        _request._get('/car/productx', data, function (response) {
            if (response.code !== _request.success) {
                Message.info(response.msg);
                return;
            }
            //回调数据
            if (typeof callback === 'function') {
                callback(response.data)
            }
        })
    },


};
export default lib_car
